package com.nuonuo.dubbo.auth.config;

import org.apache.dubbo.config.SslConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author duan
 * @version 1.0
 * @date 2023/2/24 10:11
 */
@Configuration
public class WebMvcConfig {

    @Bean
    public SslConfig sslConfig() {
        SslConfig sslConfig = new SslConfig();

        // 单向开始， 如果被认证方是consumer， 设置下面两个
//        sslConfig.setClientKeyCertChainPath("F:/spring-boot-dubbo-demo-master/cacert.pem");
//        sslConfig.setClientPrivateKeyPath("F:/spring-boot-dubbo-demo-master/privkey.pem");
//        //       sslConfig.setClientKeyPassword("123456");
        //
        sslConfig.setClientTrustCertCollectionPath("F:\\person\\code\\test-demo\\dubbo-samples-ssl\\dubbo-samples-ssl-consumer\\src\\main\\resources\\certs\\ca.pem");

        return sslConfig;
    }
}
